#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include"global.h"
del(){
	char named[20];
	CI *p2,*p1,*p;
	p1=head;
	p=head;
	if (p== NULL ){	
		printf("delete.c : LinkList is empty that can not delete\n");
		return(0);
	}
	printf("\nfind the name of the one you need to delete\n");
	find();
	printf("\nenter the exact name you need to delete\n");
	scanf("%[^\n]",named);getchar();
	while (strcmp(p1->name,named)!=0&&p1->next!=NULL){
		p2 = p1;
		p1 = p1->next;
	}
	if(strcmp(p1->name,named)==0){
		if(p==p1)
			p=p->next;
		else{
			p2->next=p1->next;
			free(p1);
		}
	}
	else
		printf("\nNot found!\n");
	head=p;

}




